'\" te
.\" Copyright (c) 2008, Sun Microsystems, Inc., All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH DEV_OPS 9S "Sep 16, 2008"
.SH NAME
dev_ops \- device operations structure
.SH SYNOPSIS
.nf
#include <sys/conf.h>
#include <sys/devops.h>
.fi

.SH INTERFACE LEVEL
illumos DDI specific (illumos DDI).
.SH DESCRIPTION
\fBdev_ops\fR contains driver common fields and pointers to the \fBbus_ops\fR
and \fBcb_ops\fR(9S).
.sp
.LP
Following are the device functions provided in the device operations structure.
All fields must be set at compile time.
.sp
.ne 2
.na
\fB\fBdevo_rev\fR\fR
.ad
.RS 17n
Driver build version. Set this to \fBDEVO_REV\fR.
.RE

.sp
.ne 2
.na
\fB\fBdevo_refcnt\fR\fR
.ad
.RS 17n
Driver reference count. Set this to \fB0\fR.
.RE

.sp
.ne 2
.na
\fB\fBdevo_getinfo\fR\fR
.ad
.RS 17n
Get device driver information (see \fBgetinfo\fR(9E)).
.RE

.sp
.ne 2
.na
\fB\fBdevo_identify\fR\fR
.ad
.RS 17n
This entry point is obsolete. Set to \fBnulldev\fR.
.RE

.sp
.ne 2
.na
\fB\fBdevo_probe\fR\fR
.ad
.RS 17n
Probe device. See \fBprobe\fR(9E).
.RE

.sp
.ne 2
.na
\fB\fBdevo_attach\fR\fR
.ad
.RS 17n
Attach driver to \fBdev_info\fR. See \fBattach\fR(9E).
.RE

.sp
.ne 2
.na
\fB\fBdevo_detach\fR\fR
.ad
.RS 17n
Detach/prepare driver to unload. See \fBdetach\fR(9E).
.RE

.sp
.ne 2
.na
\fB\fBdevo_reset\fR\fR
.ad
.RS 17n
Reset device. (Not supported in this release.) Set this to \fBnodev\fR.
.RE

.sp
.ne 2
.na
\fB\fBdevo_cb_ops\fR\fR
.ad
.RS 17n
Pointer to \fBcb_ops\fR(9S) structure for leaf drivers.
.RE

.sp
.ne 2
.na
\fB\fBdevo_bus_ops\fR\fR
.ad
.RS 17n
Pointer to bus operations structure for nexus drivers. Set this to \fINULL\fR
if this is for a leaf driver.
.RE

.sp
.ne 2
.na
\fB\fBdevo_power\fR\fR
.ad
.RS 17n
Power a device attached to system. See \fBpower\fR(9E).
.RE

.sp
.ne 2
.na
\fB\fBdevo_quiesce\fR\fR
.ad
.RS 17n
Quiesce a device attached to system (see \fBquiesce\fR(9E) for more
information). This can be set to \fBddi_quiesce_not_needed()\fR if the driver
does not need to implement quiesce.
.RE

.SH STRUCTURE MEMBERS
.in +2
.nf
int             devo_rev;
int             devo_refcnt;
int             (*devo_getinfo)(dev_info_t *dip,
                ddi_info_cmd_t infocmd, void *arg, void **result);
int             (*devo_identify)(dev_info_t *dip);
int             (*devo_probe)(dev_info_t *dip);
int             (*devo_attach)(dev_info_t *dip,
                ddi_attach_cmd_t cmd);
int             (*devo_detach)(dev_info_t *dip,
                ddi_detach_cmd_t cmd);
int             (*devo_reset)(dev_info_t *dip, ddi_reset_cmd_t cmd);
struct cb_ops   *devo_cb_ops;
struct bus_ops  *devo_bus_ops;
int             (*devo_power)(dev_info_t *dip, int component, int level);
int             (*devo_quiesce)(dev_info_t *dip);
.fi
.in -2

.SH SEE ALSO
.BR attach (9E),
.BR detach (9E),
.BR getinfo (9E),
.BR power (9E),
.BR probe (9E),
.BR quiesce (9E),
.BR nodev (9F)
.sp
.LP
\fIWriting Device Drivers\fR
